#ifndef STRING_H
#define STRING_H

#include <cstring>
#include <cstdlib>

class String{
	public:
		String();
		String(const char*);
		String(char, unsigned n = 1);
		String(const String&);
		~String();
		String& operator=(const String&);

		unsigned size() const;
		String operator+(const String&) const;
		String &operator+=(const String &);
		char& operator[](unsigned) const;
		char* toStr() const;
	private:
		static const unsigned INCREMENT = 10;

		char *m_base;
		unsigned m_size;
		unsigned m_spaceSize;
};

std::ostream& operator<<(std::ostream& os, const String &s);

inline String::String()
	: m_base(nullptr), m_size(0), m_spaceSize(0)
{}


#endif /* STRING_H */
